package iwpl.project.entities;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Apartments entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Apartments")
public class Apartments implements java.io.Serializable {

	// Fields

	private Integer id;
	private Areas areas;
	private String apartmentNumber;
	private Integer floorNumber;
	private Double value;
	private Boolean status;
	private Set<EquipmentDetails> equipmentDetailses = new HashSet<EquipmentDetails>(
			0);
	private Set<Contracts> contractses = new HashSet<Contracts>(0);
	private Set<Customers> customerses = new HashSet<Customers>(0);

	// Constructors

	/** default constructor */
	public Apartments() {
	}

	/** minimal constructor */
	public Apartments(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public Apartments(Integer id, Areas areas, String apartmentNumber,
			Integer floorNumber, Double value, Boolean status,
			Set<EquipmentDetails> equipmentDetailses,
			Set<Contracts> contractses, Set<Customers> customerses) {
		this.id = id;
		this.areas = areas;
		this.apartmentNumber = apartmentNumber;
		this.floorNumber = floorNumber;
		this.value = value;
		this.status = status;
		this.equipmentDetailses = equipmentDetailses;
		this.contractses = contractses;
		this.customerses = customerses;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "AreaID")
	public Areas getAreas() {
		return this.areas;
	}

	public void setAreas(Areas areas) {
		this.areas = areas;
	}

	@Column(name = "ApartmentNumber", length = 30)
	public String getApartmentNumber() {
		return this.apartmentNumber;
	}

	public void setApartmentNumber(String apartmentNumber) {
		this.apartmentNumber = apartmentNumber;
	}

	@Column(name = "FloorNumber")
	public Integer getFloorNumber() {
		return this.floorNumber;
	}

	public void setFloorNumber(Integer floorNumber) {
		this.floorNumber = floorNumber;
	}

	@Column(name = "Value", precision = 53, scale = 0)
	public Double getValue() {
		return this.value;
	}

	public void setValue(Double value) {
		this.value = value;
	}

	@Column(name = "Status")
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "apartments")
	public Set<EquipmentDetails> getEquipmentDetailses() {
		return this.equipmentDetailses;
	}

	public void setEquipmentDetailses(Set<EquipmentDetails> equipmentDetailses) {
		this.equipmentDetailses = equipmentDetailses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "apartments")
	public Set<Contracts> getContractses() {
		return this.contractses;
	}

	public void setContractses(Set<Contracts> contractses) {
		this.contractses = contractses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "apartments")
	public Set<Customers> getCustomerses() {
		return this.customerses;
	}

	public void setCustomerses(Set<Customers> customerses) {
		this.customerses = customerses;
	}

}